package com.zzh.zzhaiagent.configure;

import com.zzh.zzhaiagent.tools.*;
import jakarta.annotation.Resource;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 集成注册工具
 */
@Configuration
public class ToolRegistration {

    @Resource
    private FileOperationTool fileOperationTool;

    @Resource
    private WebSearchTool webSearchTool;

    @Resource
    private WebScrapingTool webScrapingTool;

    @Resource
    private ResourceDownloadTool resourceDownloadTool;

    @Resource
    private TerminalOperationTool terminalOperationTool;

    @Resource
    private PDFGenerationTool pdfGenerationTool;

    @Resource
    private TerminateTool terminateTool;

    @Bean
    public ToolCallback[] allTools() {
        return ToolCallbacks.from(
                fileOperationTool,
                webSearchTool,
                webScrapingTool,
                resourceDownloadTool,
                terminalOperationTool,
                pdfGenerationTool,
                terminateTool
        );
    }

}
